{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<a href=\"https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv\" target=\"_blank\"><img align=\"left\" src=\"data/cover.jpg\" style=\"width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;\"></a>\n",
    "*This notebook contains an excerpt from the book [Machine Learning for OpenCV](https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv) by Michael Beyeler.\n",
    "The code is released under the [MIT license](https://opensource.org/licenses/MIT),\n",
    "and is available on [GitHub](https://github.com/mbeyeler/opencv-machine-learning).*\n",
    "\n",
    "*Note that this excerpt contains only the raw code - the book is rich with additional explanations and illustrations.\n",
    "If you find this content useful, please consider supporting the work by\n",
    "[buying the book](https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv)!*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Classifying Emails Using the Naive Bayes Classifier](07.02-Classifying-Emails-Using-Naive-Bayes.ipynb) | [Contents](../README.md) | [Understanding k-means clustering](08.01-Understanding-k-Means-Clustering.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Discovering Hidden Structures with Unsupervised Learning\n",
    "\n",
    "So far, we have focused our attention exclusively on supervised learning problems, where\n",
    "every data point in the dataset had a known label or target value. However, what do we do\n",
    "when there is no known output, or no teacher to supervise the learning algorithm?\n",
    "\n",
    "This is what **unsupervised learning** is all about. In unsupervised learning, the learning is\n",
    "shown only in the input data and is asked to extract knowledge from this data without\n",
    "further instruction. We have already talked about one of the many forms that unsupervised\n",
    "learning comes in—**dimensionality reduction**. Another popular domain is cluster analysis,\n",
    "which aims to partition data into distinct groups of similar items.\n",
    "\n",
    "In this chapter, we want to understand how different clustering algorithms can be used to\n",
    "extract hidden structures in simple, unlabeled datasets. These hidden structures have many\n",
    "benefits, whether they are used in feature extraction, image processing, or even as a\n",
    "preprocessing step for supervised learning tasks. As a concrete example, we will learn how\n",
    "to apply clustering to images in order to reduce their color spaces to 16 bits.\n",
    "\n",
    "More specifically, we want to answer the following questions:\n",
    "- What are $k$-means clustering and expectation-maximization, and how do I implement these things in OpenCV?\n",
    "- How can I arrange clustering algorithms in hierarchical trees, and what are the benefits that come from that?\n",
    "- How can I use unsupervised learning for preprocessing, image processing, and classification?\n",
    "\n",
    "\n",
    "## Outline\n",
    "\n",
    "- [Understanding k-Means Clustering](08.01-Understanding-k-Means-Clustering.ipynb)\n",
    "- [Compressing Color Images Using k-Means](08.02-Compressing-Color-Images-Using-k-Means.ipynb)\n",
    "- [Classifying Handwritten Digits Using k-Means](08.03-Classifying-Handwritten-Digits-Using-k-Means.ipynb)\n",
    "- [Implementing Agglomerative Hierarchical Clustering](08.04-Implementing-Agglomerative-Hierarchical-Clustering.ipynb)\n",
    "\n",
    "Let's get started!\n",
    "\n",
    "> The book features a detailed treatment of different unsupervised learning algorithms, including a walk-through of k-means and expectation maximization. For more information on the topic, please refer to the book."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Classifying Emails Using the Naive Bayes Classifier](07.02-Classifying-Emails-Using-Naive-Bayes.ipynb) | [Contents](../README.md) | [Understanding k-means clustering](08.01-Understanding-k-Means-Clustering.ipynb) >"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
